import React from "react";
import { Routes, Route, Navigate } from "react-router-dom";
import Login from "./page/Login";
import DemoPagea from "./page/DemoPage1";
import DemoPageb from "./page/DemoPage2";
import DemoPagec from "./page/DemoPage3";
import DemoPaged from "./page/DemoPage4";
import DemoPagee from "./page/DemoPage5";
import DemoPagef from "./page/DemoPage6";
import DemoPageg from "./page/DemoPage7";
import DemoPageh from "./page/DemoPage8";

import Layout from "./components/Layout";

export default function () {
  return (
    <Routes>
      {/* 默认路径重定向到登录页 */}
      <Route
        path="/p/meihua/widgetview/"
        element={<Navigate to="/p/meihua/widgetview/login" replace />}
      />

      {/* 登录页 */}
      <Route path="/p/meihua/widgetview/login" element={<Login />} />

      {/* 主布局（包含导航栏） */}
      <Route element={<Layout />}>
        {/* 子页面 所有访问的页面请列在此*/}
        <Route path="/p/meihua/widgetview/a" element={<DemoPagea />} />
        <Route path="/p/meihua/widgetview/b" element={<DemoPageb />} />
        <Route path="/p/meihua/widgetview/c" element={<DemoPagec />} />
        <Route path="/p/meihua/widgetview/d" element={<DemoPaged />} />
        <Route path="/p/meihua/widgetview/e" element={<DemoPagee />} /> 
        <Route path="/p/meihua/widgetview/f" element={<DemoPagef />} /> 
        <Route path="/p/meihua/widgetview/g" element={<DemoPageg />} /> 
        <Route path="/p/meihua/widgetview/h" element={<DemoPageh />} />  

      </Route>
    </Routes>
  );
}
